package stack;

/**
 * 调试类
 *
 * @author wt
 */
public class Main {
    public static void main(String args[]) {
        SeqStack<String> seqStack = new SeqStack<String>(5);
        System.out.println("<顺序栈> ");
        char ch = 'a';

        System.out.print("入栈操作: ");
        for (int i = 0; i < 5; i++) {
            String str = (char) (ch + i) + "";
            seqStack.push(str);
            System.out.print(str + "  ");
        }
        System.out.println();
        System.out.print("出栈操作: ");
        while (!seqStack.isEmpty()) {
            System.out.print(seqStack.pop().toString() + "  ");
        }

        System.out.println("\n\n----------分割线-----------\n");

        LinkedStack<Integer> linkedStack = new LinkedStack<Integer>();
        System.out.println("<链式栈>");
        System.out.print("入栈操作: ");
        for (int i = 1; i <= 5; i++) {
            Integer intobj = new Integer(i);
            linkedStack.push(intobj);
            System.out.print(intobj + "  ");
        }
        System.out.println();

        linkedStack.toString();
        System.out.print("出栈操作: ");
        while (!linkedStack.isEmpty()) {
            System.out.print(linkedStack.pop().toString() + "  ");
        }
    }
}
